package com.magenta.maxoptra.gis.utils;

import com.magenta.maxoptra.gis.GeographicCoordinates;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: kuznetsovd
 * Date: 05.12.12
 * Time: 14:30
 * To change this template use File | Settings | File Templates.
 */
public class GetRoutePointsByCoordsProfiler extends AbstractGisProfiler {

    private String coordsDefinition = "";

    public GetRoutePointsByCoordsProfiler(String provider, String accountGlobalId, boolean enableProfiling, List<? extends GeographicCoordinates> coordinates) {
        super(provider, accountGlobalId, enableProfiling);
        for (GeographicCoordinates c : coordinates) {
            coordsDefinition = coordsDefinition + printPoint(c) + ":";
        }
    }

    public GetRoutePointsByCoordsProfiler(String provider, String accountGlobalId, boolean enableProfiling, GeographicCoordinates from, GeographicCoordinates to) {
        super(provider, accountGlobalId, enableProfiling);
        coordsDefinition = coordsDefinition + printPoint(from) + ":" + printPoint(to);
    }

    @Override
    public String getInitialInfo() {
        return provider + separator + accountGlobalId + separator + coordsDefinition;
    }

    public void logDuration(int size) {
        logDuration("pathPoints.count:"+size);
    }

}
